<template>
 <view class="fixtipo">
	 <view :style="{height:getstateheight()+'px'}"> </view>
	 <view class="tittop" :style="{height:gettitileheight()+'px'}"> 
	       <view style="width:50rpx;" class="iconfont icon-fanhui" @click="bak"></view>
	       <view class="">账号与安全</view>
	       <view style="width:50rpx;" class=""></view>
	 </view>
 </view>
 <view class="con">
	   <view class="" @click="baibia">
		   <view class="">注销账号</view>
		   <view class="r">此过程不可逆，谨慎选择！<view class="iconfont icon-fanhui"></view></view>
	   </view>
 </view>
</template>

<script setup>
		import {getstateheight,gettitileheight} from '@/utils/getinfo.js'
		import {userbaibai} from '@/api/index.js'
		const heightbox=getstateheight()+gettitileheight()+'px'
		const bak=()=>{
			uni.navigateBack()
		}
		const baibia=()=>{
			 uni.showModal({
			 	title:"警告！",
				content:"确定要注销？过程不可逆！",
				success(e) {
					if(e.confirm){
						bai()
					}
				}
			 })
		}
		const bai=async()=>{
			const rudata=await userbaibai()
			if(rudata.code==200){
				uni.showToast({
					title:"注销成功！",
					icon:"none"
				})
				setTimeout(()=>{
					  uni.reLaunch({
					  	url:"/pages/login/login"
					  })
				},3000)
			}
		}
</script>

<style lang="scss" scoped>
	.fixtipo{
		background-color: #f7f7f7;
		.tittop{
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 25rpx;
			font-size: 25rpx;
			.iconfont{
				font-size: 25rpx;
			}
		}
	}
	.con{
		background-color: #f7f7f7;
		height: calc(100vh - v-bind(heightbox));
		padding:20rpx 25rpx 0 25rpx;
		>view{
			height: 85rpx;
			font-size: 25rpx;
			background-color: #fff;
			border-radius: 20rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 20rpx;
			.r{
				display: flex;
				font-size: 20rpx;color: #adadad;
			}
		}
		.icon-fanhui{
			transform: rotate(180deg);
			font-size: 25rpx;
		}
	}
</style>
